package com.yscp.ysdemo.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.math.BigDecimal;
import lombok.Data;
import org.apache.ibatis.annotations.Update;

/**
 * @TableName user_extend
 */
@TableName(value ="user_extend")
@Data
public class UserExtend implements Serializable {
    @TableId
    private Long userId;

    private String description;

    private Integer sex;

    private BigDecimal money;

    private Integer level;

    private Integer commentedMsgCount;

    private Integer sysmMsgCount;

    private Integer likeMsgCount;

    private Integer likeCount;

    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserExtend other = (UserExtend) that;
        return (this.getUserId() == null ? other.getUserId() == null : this.getUserId().equals(other.getUserId()))
            && (this.getDescription() == null ? other.getDescription() == null : this.getDescription().equals(other.getDescription()))
            && (this.getSex() == null ? other.getSex() == null : this.getSex().equals(other.getSex()))
            && (this.getMoney() == null ? other.getMoney() == null : this.getMoney().equals(other.getMoney()))
            && (this.getLevel() == null ? other.getLevel() == null : this.getLevel().equals(other.getLevel()))
            && (this.getCommentedMsgCount() == null ? other.getCommentedMsgCount() == null : this.getCommentedMsgCount().equals(other.getCommentedMsgCount()))
            && (this.getSysmMsgCount() == null ? other.getSysmMsgCount() == null : this.getSysmMsgCount().equals(other.getSysmMsgCount()))
            && (this.getLikeMsgCount() == null ? other.getLikeMsgCount() == null : this.getLikeMsgCount().equals(other.getLikeMsgCount()))
            && (this.getLikeCount() == null ? other.getLikeCount() == null : this.getLikeCount().equals(other.getLikeCount()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getUserId() == null) ? 0 : getUserId().hashCode());
        result = prime * result + ((getDescription() == null) ? 0 : getDescription().hashCode());
        result = prime * result + ((getSex() == null) ? 0 : getSex().hashCode());
        result = prime * result + ((getMoney() == null) ? 0 : getMoney().hashCode());
        result = prime * result + ((getLevel() == null) ? 0 : getLevel().hashCode());
        result = prime * result + ((getCommentedMsgCount() == null) ? 0 : getCommentedMsgCount().hashCode());
        result = prime * result + ((getSysmMsgCount() == null) ? 0 : getSysmMsgCount().hashCode());
        result = prime * result + ((getLikeMsgCount() == null) ? 0 : getLikeMsgCount().hashCode());
        result = prime * result + ((getLikeCount() == null) ? 0 : getLikeCount().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", userId=").append(userId);
        sb.append(", description=").append(description);
        sb.append(", sex=").append(sex);
        sb.append(", money=").append(money);
        sb.append(", level=").append(level);
        sb.append(", commentedMsgCount=").append(commentedMsgCount);
        sb.append(", sysmMsgCount=").append(sysmMsgCount);
        sb.append(", likeMsgCount=").append(likeMsgCount);
        sb.append(", likeCount=").append(likeCount);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }



    public boolean UpdateIsNotEmpty(){
        boolean isNotEmpty = true;
        if (userId == null){
            return false;
        }

        return  true;
    }
}